package com.youlian.manager.api;

import com.youlian.manager.param.CardDetailedParam;
import com.youlian.manager.param.CardsParam;
import com.youlian.manager.param.ParametersUtils;


public class CardAPI extends BaseAPI{

	/**
	 * 首页
	 * @param UserParam
	 * @return
	 * @throws Exception
	 */
	public String getCards(CardsParam p) throws Exception {

		ParametersUtils params = new ParametersUtils(p);

		params.addStringParam("service", p.getService());
		params.addStringParam("user_token", p.getUser_token());
		params.addStringParam("channel_id", p.getChannel_id());

		return doGet(params.getReqURL());
	}
	
	/**
	 * 会员卡详情
	 * @param UserParam
	 * @return
	 * @throws Exception
	 */
	public String getCardDet(CardDetailedParam p) throws Exception {

		ParametersUtils params = new ParametersUtils(p);

		params.addStringParam("service", p.getService());
		params.addStringParam("card_id", p.getCard_id());

		return doGet(params.getReqURL());
	}
	
	/**
	 * 商家详情
	 * @param UserParam
	 * @return
	 * @throws Exception
	 */
	public String getStoreDet(CardDetailedParam p) throws Exception {

		ParametersUtils params = new ParametersUtils(p);

		params.addStringParam("service", p.getService());
		params.addStringParam("card_id", p.getCard_id());

		return doGet(params.getReqURL());
	}
	
}
